﻿
@{
    Layout = null;
}

<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title> </title>
    <script type="text/javascript">
        function Save() {
            var myObject = {};
            myObject.id = "1";
            myObject.userName = document.getElementById("userName").value;
            myObject.age = document.getElementById("age").value;
            myObject.selSex = document.getElementById("selSex").value;
            var params = new URLSearchParams(myObject);
            var saveUrl = "/SendParameters/SaveDoc";
            pageofficectrl.SaveFilePage = `${saveUrl}?${params.toString()}`;
            pageofficectrl.WebSave();
        }
        
        function Close() {
            pageofficectrl.CloseWindow()
        }
        function IsFullScreen() {
            pageofficectrl.FullScreen =
                !pageofficectrl.FullScreen;
        }

        function OnPageOfficeCtrlInit() {
            pageofficectrl.Caption = "演示：向保存页面传递参数，更新人员信息";
            pageofficectrl.AddCustomToolButton("保存", "Save", 1);
            pageofficectrl.AddCustomToolButton("全屏/还原", "IsFullScreen", 4);
            pageofficectrl.AddCustomToolButton("-", "", 0);
            pageofficectrl.AddCustomToolButton("关闭", "Close", 21);
        }
    </script>
</head>
<body >
    <form id="form1">
        <div style="font-size: 14px;">
            <div style="border:1px solid black;">
                PageOffice给保存页面传值的三种方式：<br/>
                <span>1.通过设置保存页面的url中的?给保存页面传递参数：</span><br>               
                <span>2.通过input隐藏域给保存页面传递参数：</span><br/>
                <span>3.通过Form控件给保存页面传递参数(这里的Form控件包括输入框、下拉框、单选框、复选框、TextArea等类型的控件)：</span><br/>              
            </div>
            <span style="color: Red;">更新人员信息：</span><br />
            <input id="age" name="age" type="hidden" value="25" />
            <span style="color: Red;">姓名：</span><input id="userName" name="userName" type="text" value="张三" /><br />
            <span style="color: Red;">性别：</span><select id="selSex" name="selSex">
                <option value="男">男</option>
                <option value="女">女</option>
            </select>
        </div>
        <div style="width: auto; height: 900px;">
            @Html.Raw(ViewBag.poCtrl)
        </div>
    </form>
</body>
</html>
